<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
    var date1 = new Date('2020-6-19 12:00:33');
    var date2 = new Date('2020-7-12 10:12:00');

    var time1 = date1.getTime();
    var time2 = date2.getTime();

    var chaTime = Math.abs(time1 - time2);

    var day = parseInt(chaTime/1000/60/60/24);
    var hours = parseInt((chaTime/1000/60/60) % 24);
    var minute = parseInt((chaTime/1000/60) % 60);
    var millisecond = parseInt((chaTime/1000) % 60);

    console.log(date1 + date2 + '相差' + day + '天' + hours + '小时' + minute + '分钟' + millisecond + '毫秒');
    
</script>
</html>